<template>
    <div>
        <el-card style="text-align: left"  v-for="spec in form.spuDetails.specifications">
            <div slot="header">
                <span>{{spec.group}}</span>
            </div>
            <!--如果是全局的并且options长度为0，就显示出输入框-->
            <el-input v-for="param in spec.params" class="item"
                      v-if="param.global && param.options.length === 0"
                      :placeholder="param.k" :key="param.k" v-model="param.v">
            </el-input>
            <!--如果是全局并且options长度大于0，就显示下拉菜单-->
            <el-select v-for="param in spec.params" class="item"
                       v-if="param.global && param.options.length > 0"
                       :key="param.k" v-model="param.v">
                <el-option v-for="op in param.options" :label="op" :value="op">
                </el-option>
            </el-select>
        </el-card>
    </div>

</template>

<script>
    export default {
        name: "GoodsSpec",
        props:{
            form:{
                type:Object
            }
        }
    }
</script>

<style scoped>
    .item{
        margin-top:5px;
    }
</style>